package com.ruoyi.project.system.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.dyun.tool.mybatis.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.dreamlu.mica.core.validation.CreateGroup;
import net.dreamlu.mica.core.validation.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 菜单表 sys_menu
 *
 * @author dy
 */
@TableName("sys_menu")
@EqualsAndHashCode(callSuper = true)
@Data
public class SysMenu extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 父菜单ID
     */
    private Long parentId;

    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称不能为空", groups = {CreateGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "菜单名称长度不能超过50个字符")
    private String menuName;

    /**
     * 菜单类型（C菜单 F按钮）
     */
    @NotBlank(message = "菜单类型不能为空", groups = {CreateGroup.class, UpdateGroup.class})
    private String menuType;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 权限标识
     */
    @Size(max = 100, message = "权限标识长度不能超过100个字符")
    private String perms;

    /**
     * 排序
     */
    @NotNull(message = "菜单顺序不能为空", groups = {CreateGroup.class, UpdateGroup.class})
    private Integer seq;

    /**
     * 路由地址
     */
    @NotBlank(message = "路由地址不能为空", groups = {CreateGroup.class, UpdateGroup.class})
    private String path;

    /**
     * 组件路径
     */
    private String component;

    /**
     * 是否为外链（0否 1是）
     */
    private Integer isExternal;

    /**
     * 备注
     */
    private String remark;

    /**
     * 菜单状态（0显示 1隐藏 2停用）
     */
    private Integer status;

}
